<?php /*a:2:{s:52:"F:\CaOadmin\application\admin\view\config\index.html";i:1569726944;s:37:"../application/admin/view/layout.html";i:1569485205;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title><?php echo htmlentities($title); ?></title>

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="shortcut icon" href="favicon.ico">
    <link href="<?php echo staticResource('css/bootstrap.min.css?v=3.3.6'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('css/font-awesome.min.css?v=4.4.0'); ?>" rel="stylesheet">
    


    <link href="<?php echo staticResource('css/animate.css'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('css/style.css?v=4.1.0'); ?>" rel="stylesheet">
    <link href="<?php echo staticResource('extend/common.css'); ?>" rel="stylesheet">
</head>

<body class="fixed-sidebar full-height-layout gray-bg">

<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <?php if(empty($data)): ?>
                    当前没有任何配置项
                    <?php else: ?>
                    <form method="post" class="form-horizontal">
                        <?php foreach($data as $conf): ?>
                        <div class="form-group">
                            <label class="col-md-1 control-label"><?php echo htmlentities($conf['title']); ?></label>
                            <div class="col-md-7">
                            <?php if($conf['type'] == 'image'): ?>
                                <div class="input-group">
                                    <div class="file-area">
                                        <div class="file-pretty">
                                            <input type="file" class="form-control" style="display: none;">
                                            <div class="input-append input-group">
                                                <span class="input-group-btn">
                                                    <button class="btn btn-white select" type="button">选择文件</button>
                                                </span>
                                                <input class="input-large form-control" type="text" name="<?php echo htmlentities($conf['key']); ?>"  value="<?php echo htmlentities($conf['value']); ?>" readonly>
                                                <img class="beforeView" src="" style="display: none;">
                                            </div>
                                        </div>
                                        <div class="back-change btn btn-primary">查看图片</div>
                                    </div>
                                    <span class="input-group-btn">
                                        <button type="button" class="btn btn-primary" onclick="save_conf('<?php echo htmlentities($conf['key']); ?>')">修改</button>
                                    </span>
                                </div>
                            <?php elseif($conf['type'] == 'switch'): ?>
                                <div class="switch" style="margin-top: 7px;">
                                    <div class="onoffswitch">
                                        <input type="checkbox"  class="onoffswitch-checkbox" data-url="<?php echo url('config/save'); ?>" data-id="<?php echo htmlentities($conf['key']); ?>" id="sys-conf-<?php echo htmlentities($conf['key']); ?>" <?php if($conf['value'] == 1): ?>checked<?php endif; ?>>
                                        <label class="onoffswitch-label" for="sys-conf-<?php echo htmlentities($conf['key']); ?>">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>
                                </div>
                            <?php else: ?>
                                <div class="input-group">
                                    <input type="text" class="form-control" id="<?php echo htmlentities($conf['key']); ?>" value="<?php echo htmlentities($conf['value']); ?>">
                                    <span class="input-group-btn">
                                        <button type="button" class="btn btn-primary" onclick="save_conf('<?php echo htmlentities($conf['key']); ?>')">修改</button>
                                    </span>
                                </div>
                            <?php endif; ?>
                            </div>
                            <div class="col-md-4 form-control-static">
                                <?php echo htmlentities($conf['describe']); ?>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </form>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>

</div>


<!-- 全局js -->
<script src="<?php echo staticResource('js/jquery.min.js?v=2.1.4'); ?>"></script>
<script src="<?php echo staticResource('js/bootstrap.min.js?v=3.3.6'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/metisMenu/jquery.metisMenu.js'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/slimscroll/jquery.slimscroll.min.js'); ?>"></script>
<script src="<?php echo staticResource('js/plugins/layer/layer.min.js'); ?>"></script>
<script src="<?php echo staticResource('extend/common.js'); ?>"></script>

<!-- 自定义js -->


<script>
    // 提交表单
    function save_conf(key) {
        http_post(
            "<?php echo url('config/save'); ?>",
            $('#admin-info').serialize(),
            function (res) {
                layer.msg('保存成功',{icon:1},function () {
                    parent.location.reload();
                })
            }
        )
        return false;
    }

</script>


</body>

</html>
